package com.Ajava1801D.并发包.conditation01;

import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2020/10/7  13:58
 * 描述:
 */
public class MyRunable004 implements Runnable {

    private Condition condition;

    private Lock lock;

    public MyRunable004(Condition condition, Lock lock) {
        this.condition = condition;
        this.lock = lock;
    }

    @Override
    public void run() {
        lock.lock();

        try{
            System.out.println("==============0004");
            condition.signalAll();
        }finally {
            lock.unlock();
        }

    }
}
